<style lang="less">
@import '../assets/style/common.less';
</style>

<template>
    <div class="head">
        <form action="/">
            <van-nav-bar fixed>
				<i slot="left" class="iconfont icon-fanhui"  v-show="isIconShow" @click="headerClick($event,-1)"/>
				<!-- <van-icon name="arrow-left" slot="left" v-show="isIconShow" @click="headerClick($event,-1)"/> -->
                <!-- <van-icon class="iconfont icon-fanhui" slot="left" v-show="isIconShow" @click="headerClick($event,-1)"/> -->
				<div slot="title">
					<slot name="headerTitle"></slot>
				</div>
				<div slot="right" @click="headerClick($event,0)">
					<slot name="headerRight" >
					</slot>
				</div>
			</van-nav-bar>
        </form>
    </div>
</template>

<script>
import {
    NavBar,
    Icon
} from 'vant';

export default {
	name: 'heade',
	data() {
		return {
			value: ""
		}
	},
	props: {
		isIconShow: {//是否显示左侧箭头图标
			type: Boolean,
			default: true
		}
	},
    components: {
		[NavBar.name]: NavBar,
        [Icon.name]: Icon
    },
    methods: {
        headerClick(data,num) {
        		let _this = window.thisWeb
	        	if(num == '-1'){
	        		_this.goBack()
//	        		this.$router.go(-1)
	        	}else{
	        		let para = {}
	            para.back = num
	            para.data = data
	            this.$emit('headerClick',para)
	        	}
		}
	}
}
</script>